package com.cookbook.animals;

import android.content.*;
import android.database.sqlite.*;
import android.widget.Toast;
import java.util.*;


public class DatabaseHelper extends SQLiteOpenHelper {
	// Make strings to hold the path to the database and the database name
	private static final String DB_NAME = "animals.db";
	
	// Declare size of variable
	static final int DB_SIZE = 30;
	
	// Create variable to hold the context
	Context myContext;
	
	// Make a variable to hold SQLite statements
	//SQLiteStatement statement;
	
	// Make constructor
	public DatabaseHelper(Context context){
		// Call super function and set current context
		super(context, DB_NAME, null, 2);
		myContext = context;
	}
	
	// Override onCreate function
	@Override
	public void onCreate(SQLiteDatabase db){
		// Add default table
		db.execSQL("CREATE TABLE IF NOT EXISTS default_user (_id INTEGER PRIMARY KEY, match1 TEXT, match2 TEXT, match3 TEXT, frequency NUMERIC, color NUMERIC);");
		
		// Make a variable to hold sqlite statements
		SQLiteStatement statement;
		
		// Add data to animals table
		statement = db.compileStatement("INSERT INTO default_user VALUES(1,'cow','count','camp',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(2,'pig','egg','hey',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(3,'dog','dial','cog',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(4,'horse','hoarse','corse',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(5,'sheep','cheap','heat',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(6,'cat','cast','hat',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(7,'chicken','hen','rooster',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(8,'squirrel','30','turd',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(9,'duck','huck','puck',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(10,'frog','toad','rob',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(11,'turkey','toad','rob',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(12,'lion','ryan','brian',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(13,'tiger','toad','rob',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(14,'bear','there','hair',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(15,'monkey','toad','rob',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(16,'fish','dish','fishy',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(17,'parrot','carot','carat',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(18,'dolphin','doll','frolfin',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(19,'eagle','tickle','beagle',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(20,'donkey','dorky','dinkey',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(21,'wolf','wall','wool',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(22,'snake','snare','snape',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(23,'mouse','mice','mousie',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(24,'elephant','telephone','elle',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(25,'bee','beer','bean',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(26,'bat','but','bunt',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(27,'cricket','bum','bug',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(28,'goose','gas','lo0se',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(29,'rooster','toaster','roast',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO default_user VALUES(30,'owl','howl','towel',1,0);");
		statement.executeInsert();
		
		// Add stats table
		db.execSQL("CREATE TABLE IF NOT EXISTS stats (_id INTEGER PRIMARY KEY, name TEXT, password TEXT, correct NUMERIC, total NUMERIC);");
	
		// Add data to stats table
		statement = db.compileStatement("INSERT INTO stats VALUES(1,'default_user','nothing',0,0);");
		statement.executeInsert();
		
		// Add db_info table
		db.execSQL("CREATE TABLE IF NOT EXISTS db_info (_id INTEGER PRIMARY KEY, num_users NUMERIC);");
		
		// Add only row to db_info table
		statement = db.compileStatement("INSERT INTO db_info VALUES(1,1);");
		statement.executeInsert();
		
		// If so then add matches database
		db.execSQL("CREATE TABLE IF NOT EXISTS matches (_id INTEGER PRIMARY KEY, animal_id NUMERIC, name TEXT);");
		
		// Add data to this table
		statement = db.compileStatement("INSERT INTO matches VALUES(1, 1,'caps');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(2, 1,'cap');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(3, 1,'capp');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(4, 1,'cal');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(5, 1,'count');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(6, 1,'ciao');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(7, 1,'camp');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(8, 1,'cow');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(9, 1,'calif');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(10, 1,'cab');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(11, 1,'cows');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(12, 2,'big');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(13, 2,'pig');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(14, 2,'peggy');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(15, 2,'pic');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(16, 2,'take it');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(17, 2,'peg');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(18, 2,'piggy');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(19, 2,'pigs');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(20, 2,'pink');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(21, 2,'digi');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(22, 2,'pinky');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(23, 2,'i think');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(24, 2,'i think you');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(25, 2,'tiki');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(26, 2,'picky');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(27, 3,'dog');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(28, 3,'docs');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(29, 3,'dogs');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(30, 3,'doug');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(31, 3,'dawg');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(32, 3,'dougy');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(33, 3,'doggy');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(34, 3,'doggie');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(35, 3,'puppy');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(36, 3,'happy');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(37, 3,'preppy');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(38, 3,'lp');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(39, 3,'pep');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(40, 3,'ok');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(41, 3,'pepe');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(42, 3,'pup');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(43, 3,'brooke');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(44, 4,'horse');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(45, 4,'course');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(46, 4,'porsche');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(47, 4,'horses');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(48, 4,'horsey');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(49, 4,'or see');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(50, 4,'or c');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(51, 4,'dorsey');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(52, 5,'sheep');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(53, 5,'cheap');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(54, 5,'puke');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(55, 5,'ship');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(56, 5,'she');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(57, 5,'i am');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(58, 5,'lamb');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(59, 5,'sam');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(60, 5,'lame');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(61, 5,'liam');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(62, 5,'i am i');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(63, 5,'she pee');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(64, 5,'she b');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(65, 5,'she be');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(66, 5,'she did');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(67, 6,'cat');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(68, 6,'cats');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(69, 6,'kat');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(70, 6,'cant');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(71, 6,'kitty');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(72, 6,'kiddy');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(73, 6,'kiddie');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(74, 6,'kitten');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(75, 6,'kittens');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(76, 6,'kidding');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(77, 6,'k');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(78, 6,'kids');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(79, 6,'kit');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(80, 6,'canton');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(81, 7,'chicken');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(82, 7,'chickens');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(83, 7,'chiken');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(84, 7,'hen');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(85, 7,'n');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(86, 7,'and');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(87, 8,'squirrel');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(88, 8,'squirrels');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(89, 8,'school');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(90, 8,'squirl');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(91, 8,'square');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(92, 8,'squirrely');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(93, 8,'squirting');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(94, 8,'squirmy');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(95, 8,'scrimmage');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(96, 9,'duck');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(97, 9,'ducks');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(98, 9,'dick');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(99, 9,'dirk');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(100, 9,'com');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(101, 9,'ducky');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(102, 9,'becky');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(103, 9,'the key');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(104, 9,'duckie');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(105, 10,'frog');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(106, 10,'frogs');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(107, 10,'prague');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(108, 10,'bronx');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(109, 10,'okay');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(110, 10,'hug');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(111, 10,'rocky');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(112, 10,'frankie');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(113, 10,'karate');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(114, 10,'froggy');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(115, 10,'hockey');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(116, 10,'truckee');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(117, 10,'bronte');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(118, 11,'turkey');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(119, 11,'turkeys');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(120, 11,'jerky');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(121, 11,'tricky');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(122, 11,'turky');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(123, 12,'lion');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(124, 12,'lions');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(125, 12,'i am');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(126, 12,'science');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(127, 12,'ryan');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(128, 12,'line');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(129, 12,'y n');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(130, 12,'brian');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(131, 13,'tiger');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(132, 13,'tigers');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(133, 13,'tucker');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(134, 13,'taggart');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(135, 13,'texas');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(136, 13,'tagger');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(137, 13,'tigerr');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(138, 14,'bear');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(139, 14,'bears');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(140, 14,'fair');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(141, 14,'bare');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(142, 14,'there');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(143, 14,'better');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(144, 14,'air');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(145, 14,'there');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(146, 14,'beer');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(147, 15,'monkey');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(148, 15,'monkeys');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(149, 15,'mckee');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(150, 15,'funky');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(151, 16,'fish');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(152, 16,'fisher');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(153, 16,'fishing');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(154, 16,'fishy');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(155, 16,'sushi');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(156, 17,'parrot');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(157, 17,'parrots');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(158, 17,'eric');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(159, 17,'aaron');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(160, 17,'garrett');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(161, 17,'paris');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(162, 17,'parents');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(163, 17,'parent');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(164, 18,'dolphin');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(165, 18,'dolphins');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(166, 18,'dothan');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(167, 18,'dawson');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(168, 18,'coffin');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(169, 18,'tobin');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(170, 18,'tolleson');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(171, 18,'dont');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(172, 19,'eagle');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(173, 19,'eagles');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(174, 19,'giggle');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(175, 19,'pico');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(176, 19,'equal');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(177, 19,'evil');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(178, 19,'people');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(179, 19,'he go');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(180, 20,'donkey');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(181, 20,'donkeys');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(182, 21,'wolf');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(183, 21,'wolves');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(184, 21,'woof');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(185, 21,'wolfe');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(186, 21,'what');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(187, 21,'wolfe');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(188, 21,'wharf');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(189, 21,'wolff');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(190, 22,'snake');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(191, 22,'snakes');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(192, 22,'sneak');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(193, 22,'speak');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(194, 22,'nick');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(195, 22,'slick');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(196, 22,'shake');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(197, 22,'cake');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(198, 22,'snick');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(199, 23,'sams');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(200, 23,'yes');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(201, 23,'the house');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(202, 23,'mouse');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(203, 23,'mice');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(204, 23,'maps');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(205, 23,'mass');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(206, 23,'s');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(207, 23,'ash');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(208, 23,'rush');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(209, 24,'elephant');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(210, 24,'elephants');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(211, 24,'note');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(212, 24,'it');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(213, 24,'p****');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(214, 24,'I wasnt');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(215, 25,'bees');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(216, 25,'bee');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(217, 25,'p');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(218, 25,'be');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(219, 25,'b');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(220, 25,'d');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(221, 26,'bat');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(222, 26,'bats');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(223, 26,'fat');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(224, 26,'pat');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(225, 26,'that');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(226, 26,'best');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(227, 26,'at');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(228, 26,'bad');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(229, 27,'cricket');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(230, 27,'crickets');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(231, 27,'f*** it');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(232, 27,'critic');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(233, 27,'critique');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(234, 27,'critics');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(235, 27,'pretty');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(236, 27,'I cant');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(237, 28,'goose');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(238, 28,'geese');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(239, 28,'guess');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(240, 28,'guss');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(241, 28,'gross');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(242, 28,'deuce');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(243, 28,'duce');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(244, 28,'boobs');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(245, 28,'dicks');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(246, 28,'this');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(247, 28,'douche');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(248, 29,'rooster');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(249, 29,'brewster');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(250, 29,'roosters');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(251, 29,'mister');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(252, 29,'register');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(253, 30,'owl');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(254, 30,'owls');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(255, 30,'howl');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(256, 30,'howls');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(257, 30,'powell');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(258, 30,'power');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(259, 30,'i will');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(260, 30,'sowell');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(261, 30,'farrell');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(262, 30,'so');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(263, 30,'howell');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(264, 30,'apple');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(265, 30,'al');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(266, 30,'aww');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(267, 30,'now');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(268, 30,'no');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(269, 30,'l');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(270, 30,'sounds');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(271, 30,'i');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(272, 30,'pound');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(273, 30,'town');");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO matches VALUES(274, 30,'wow');");
		statement.executeInsert();
	}
	
	// Override onUpgrade function
	@Override
	public void onUpgrade(SQLiteDatabase db, int old_version, int new_version){
		// Check if new version is 2 and old version is 1
		if(old_version == 1 && new_version == 2){
			Toast.makeText(myContext, "Upgrading the database", Toast.LENGTH_SHORT).show();
			
			// If so then add matches database
			db.execSQL("CREATE TABLE IF NOT EXISTS matches (_id INTEGER PRIMARY KEY, animal_id NUMERIC, name TEXT);");
			
			// Declare variable to hold sqlite statements
			SQLiteStatement statement;
			
			// Add data to this table
			statement = db.compileStatement("INSERT INTO matches VALUES(1, 1,'caps');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(2, 1,'cap');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(3, 1,'capp');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(4, 1,'cal');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(5, 1,'count');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(6, 1,'ciao');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(7, 1,'camp');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(8, 1,'cow');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(9, 1,'calif');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(10, 1,'cab');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(11, 1,'cows');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(12, 2,'big');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(13, 2,'pig');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(14, 2,'peggy');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(15, 2,'pic');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(16, 2,'take it');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(17, 2,'peg');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(18, 2,'piggy');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(19, 2,'pigs');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(20, 2,'pink');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(21, 2,'digi');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(22, 2,'pinky');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(23, 2,'i think');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(24, 2,'i think you');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(25, 2,'tiki');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(26, 2,'picky');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(27, 3,'dog');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(28, 3,'docs');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(29, 3,'dogs');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(30, 3,'doug');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(31, 3,'dawg');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(32, 3,'dougy');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(33, 3,'doggy');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(34, 3,'doggie');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(35, 3,'puppy');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(36, 3,'happy');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(37, 3,'preppy');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(38, 3,'lp');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(39, 3,'pep');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(40, 3,'ok');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(41, 3,'pepe');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(42, 3,'pup');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(43, 3,'brooke');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(44, 4,'horse');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(45, 4,'course');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(46, 4,'porsche');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(47, 4,'horses');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(48, 4,'horsey');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(49, 4,'or see');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(50, 4,'or c');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(51, 4,'dorsey');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(52, 5,'sheep');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(53, 5,'cheap');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(54, 5,'puke');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(55, 5,'ship');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(56, 5,'she');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(57, 5,'i am');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(58, 5,'lamb');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(59, 5,'sam');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(60, 5,'lame');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(61, 5,'liam');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(62, 5,'i am i');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(63, 5,'she pee');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(64, 5,'she b');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(65, 5,'she be');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(66, 5,'she did');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(67, 6,'cat');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(68, 6,'cats');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(69, 6,'kat');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(70, 6,'cant');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(71, 6,'kitty');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(72, 6,'kiddy');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(73, 6,'kiddie');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(74, 6,'kitten');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(75, 6,'kittens');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(76, 6,'kidding');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(77, 6,'k');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(78, 6,'kids');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(79, 6,'kit');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(80, 6,'canton');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(81, 7,'chicken');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(82, 7,'chickens');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(83, 7,'chiken');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(84, 7,'hen');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(85, 7,'n');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(86, 7,'and');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(87, 8,'squirrel');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(88, 8,'squirrels');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(89, 8,'school');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(90, 8,'squirl');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(91, 8,'square');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(92, 8,'squirrely');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(93, 8,'squirting');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(94, 8,'squirmy');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(95, 8,'scrimmage');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(96, 9,'duck');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(97, 9,'ducks');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(98, 9,'dick');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(99, 9,'dirk');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(100, 9,'com');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(101, 9,'ducky');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(102, 9,'becky');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(103, 9,'the key');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(104, 9,'duckie');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(105, 10,'frog');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(106, 10,'frogs');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(107, 10,'prague');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(108, 10,'bronx');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(109, 10,'okay');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(110, 10,'hug');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(111, 10,'rocky');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(112, 10,'frankie');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(113, 10,'karate');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(114, 10,'froggy');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(115, 10,'hockey');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(116, 10,'truckee');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(117, 10,'bronte');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(118, 11,'turkey');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(119, 11,'turkeys');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(120, 11,'jerky');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(121, 11,'tricky');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(122, 11,'turky');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(123, 12,'lion');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(124, 12,'lions');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(125, 12,'i am');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(126, 12,'science');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(127, 12,'ryan');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(128, 12,'line');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(129, 12,'y n');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(130, 12,'brian');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(131, 13,'tiger');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(132, 13,'tigers');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(133, 13,'tucker');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(134, 13,'taggart');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(135, 13,'texas');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(136, 13,'tagger');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(137, 13,'tigerr');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(138, 14,'bear');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(139, 14,'bears');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(140, 14,'fair');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(141, 14,'bare');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(142, 14,'there');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(143, 14,'better');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(144, 14,'air');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(145, 14,'there');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(146, 14,'beer');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(147, 15,'monkey');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(148, 15,'monkeys');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(149, 15,'mckee');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(150, 15,'funky');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(151, 16,'fish');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(152, 16,'fisher');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(153, 16,'fishing');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(154, 16,'fishy');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(155, 16,'sushi');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(156, 17,'parrot');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(157, 17,'parrots');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(158, 17,'eric');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(159, 17,'aaron');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(160, 17,'garrett');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(161, 17,'paris');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(162, 17,'parents');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(163, 17,'parent');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(164, 18,'dolphin');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(165, 18,'dolphins');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(166, 18,'dothan');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(167, 18,'dawson');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(168, 18,'coffin');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(169, 18,'tobin');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(170, 18,'tolleson');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(171, 18,'dont');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(172, 19,'eagle');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(173, 19,'eagles');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(174, 19,'giggle');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(175, 19,'pico');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(176, 19,'equal');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(177, 19,'evil');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(178, 19,'people');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(179, 19,'he go');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(180, 20,'donkey');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(181, 20,'donkeys');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(182, 21,'wolf');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(183, 21,'wolves');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(184, 21,'woof');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(185, 21,'wolfe');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(186, 21,'what');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(187, 21,'wolfe');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(188, 21,'wharf');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(189, 21,'wolff');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(190, 22,'snake');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(191, 22,'snakes');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(192, 22,'sneak');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(193, 22,'speak');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(194, 22,'nick');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(195, 22,'slick');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(196, 22,'shake');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(197, 22,'cake');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(198, 22,'snick');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(199, 23,'sams');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(200, 23,'yes');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(201, 23,'the house');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(202, 23,'mouse');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(203, 23,'mice');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(204, 23,'maps');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(205, 23,'mass');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(206, 23,'s');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(207, 23,'ash');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(208, 23,'rush');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(209, 24,'elephant');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(210, 24,'elephants');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(211, 24,'note');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(212, 24,'it');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(213, 24,'p****');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(214, 24,'I wasnt');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(215, 25,'bees');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(216, 25,'bee');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(217, 25,'p');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(218, 25,'be');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(219, 25,'b');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(220, 25,'d');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(221, 26,'bat');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(222, 26,'bats');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(223, 26,'fat');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(224, 26,'pat');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(225, 26,'that');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(226, 26,'best');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(227, 26,'at');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(228, 26,'bad');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(229, 27,'cricket');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(230, 27,'crickets');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(231, 27,'f*** it');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(232, 27,'critic');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(233, 27,'critique');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(234, 27,'critics');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(235, 27,'pretty');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(236, 27,'I cant');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(237, 28,'goose');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(238, 28,'geese');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(239, 28,'guess');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(240, 28,'guss');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(241, 28,'gross');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(242, 28,'deuce');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(243, 28,'duce');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(244, 28,'boobs');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(245, 28,'dicks');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(246, 28,'this');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(247, 28,'douche');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(248, 29,'rooster');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(249, 29,'brewster');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(250, 29,'roosters');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(251, 29,'mister');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(252, 29,'register');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(253, 30,'owl');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(254, 30,'owls');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(255, 30,'howl');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(256, 30,'howls');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(257, 30,'powell');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(258, 30,'power');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(259, 30,'i will');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(260, 30,'sowell');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(261, 30,'farrell');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(262, 30,'so');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(263, 30,'howell');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(264, 30,'apple');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(265, 30,'al');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(266, 30,'aww');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(267, 30,'now');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(268, 30,'no');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(269, 30,'l');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(270, 30,'sounds');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(271, 30,'i');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(272, 30,'pound');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(273, 30,'town');");
			statement.executeInsert();
			statement = db.compileStatement("INSERT INTO matches VALUES(274, 30,'wow');");
			statement.executeInsert();
		}
	}
	
	// Make a function to check if a string is a match for an id
	public boolean match(SQLiteDatabase db, int id, String in){
		// Check if db is null
		if(db == null){
			// If so return false
			return false;
		}
		
		// Otherwise prepare a statement to query database for string
		SQLiteStatement statement = db.compileStatement("SELECT animal_id FROM matches WHERE name = ?;");
		
		// Bind input string to first argument
		statement.bindString(1, in);
		
		// Initialize result id to -1
		int result = -1;
		
		// Try to execute query
		try{
			result = (int) statement.simpleQueryForLong();
		} catch(SQLiteDoneException e){
			// If no rows were returned then return false
			return false;
		}
		
		// Check if result id matches input id
		if(result == id){
			// If so return true
			return true;
		}
		
		// Otherwise return false
		else{
			return false;
		}
	}
	
	// Make a function to read number of users from the database
	public int getNumberUsers(SQLiteDatabase db){
		// Make sure db is not null
		if(db != null){
			// Prepare a statement to read num_users from db_info table
			SQLiteStatement statement = db.compileStatement("SELECT num_users FROM db_info WHERE _id = 1;");
			
			// Execute statement and save it to a long variable
			Long results = statement.simpleQueryForLong();
			
			// Return int value of results
			return results.intValue();
		}
		
		// Else give an error message and return -1
		else{
			Toast.makeText(myContext, "Unable to read number of users from database", Toast.LENGTH_SHORT).show();
			return -1;
		}
	}
	
	// Make a function to read an animals frequency from the database
	public Long getFrequency(SQLiteDatabase db, String user, int id){
		// Prepare a Long variable to hold results and initialize it to -1
		Long results = new Long(-1);
		
		// Make a variable to hold sqlite statements
		SQLiteStatement statement;
		
		// Make sure database is non null
		if(db != null){
			// Prepare a statement to get frequency from the database
			statement = db.compileStatement("SELECT frequency FROM "+user+" WHERE _id = ?;");
			statement.bindLong(1, id);
			
			// Execute the statement and save answer to results
			results = statement.simpleQueryForLong();
		}
		
		// Else give an error message
		else{
			Toast.makeText(myContext, "Unable to read frequency from database", Toast.LENGTH_LONG).show();
		}
		
		// Return results
		return results;
	}
	
	// Make a function to read an animals color from the database
	int getColor(SQLiteDatabase db, int id){
		// Make an int to hold return value and intialize it to -1
		int results = -1;
		
		// Make sure database is non-null
		if(db != null){
			// If so declare a variable to hold SQLiteStatements
			SQLiteStatement statement;
			
			// Prepare a statement to get animals portrait color 
			statement = db.compileStatement("SELECT color FROM default_user WHERE _id = ?;");
			statement.bindLong(1, id);
			
			// Execute statement and store value returned in integer form to results
			results = (int) statement.simpleQueryForLong();
		}
		
		// Else give error message
		else{
			Toast.makeText(myContext, "Unable to read color from database", Toast.LENGTH_SHORT).show();
		}
		
		// Return results
		return results;
	}
	
	// Make a function to read stats from the stats table
	public ArrayList<Long> getStats(SQLiteDatabase db, String user){
		// Prepare an ArrayList to hold results
		ArrayList<Long> results = new ArrayList<Long>();
		
		// Make a variable to hold sqlite statements
		SQLiteStatement statement;
		
		// Make sure database is non null
		if(db != null){
			// Prepare a statement to get correct from the database
			statement = db.compileStatement("SELECT correct FROM stats WHERE name = ?;");
			statement.bindString(1, user);
		
			// Execute the statement and save answer to results
			results.add(statement.simpleQueryForLong());
		
			// Prepare a statement to get total from the database
			statement = db.compileStatement("SELECT total FROM stats WHERE name = ?;");
			statement.bindString(1, user);
		
			// Execute the statement and save answer to results
			results.add(statement.simpleQueryForLong());
		}
		
		// Else give an error message and set results to all -1
		else{
			Toast.makeText(myContext, "Unable to read stats from database", Toast.LENGTH_LONG).show();
			Long num = new Long(-1);
			results.add(num);
			results.add(num);
		}
		
		// Return results
		return results;
	}
	
	// Make a function to update the frequency in the database
	public void updateFrequency(SQLiteDatabase db, String user, int id, int frequency){
		// Make a variable to hold SQLite statements
		SQLiteStatement statement;
		
		// Make sure db is non null
		if(db != null){
			// If so prepare statement to update frequency
			statement = db.compileStatement("UPDATE "+user+" SET frequency = ? WHERE _id = ?;");
			statement.bindLong(1, frequency);
			statement.bindLong(2, id);
			
			// Execute statement
			statement.execute();
		}
		
		// Else give an error message
		else{
			Toast.makeText(myContext, "Could not update frequency", Toast.LENGTH_SHORT).show();
		}
	}
	
	// Make a function to update the total field in the stats table
	public void updateTotal(SQLiteDatabase db, String user, int value){
		// Make a variable to hold SQLite statements
		SQLiteStatement statement;
		
		// Make sure db is non null
		if(db != null){
			// If so prepare statement to update total in stats table
			statement = db.compileStatement("UPDATE stats SET total = ? WHERE name = ?;");
			statement.bindLong(1, value);
			statement.bindString(2, user);
			
			// Execute statement
			statement.execute();
		}
		
		// Else give an error message
		else{
			Toast.makeText(myContext, "Could not update total", Toast.LENGTH_SHORT).show();
		}
	}
	
	// Make a function to update the correct field in stats table
	public void updateCorrect(SQLiteDatabase db, String user, int value){
		// Make a variable to hold SQLite statements
		SQLiteStatement statement;
		
		// Make sure db is non null
		if(db != null){
			// If so prepare statement to update total in stats table
			statement = db.compileStatement("UPDATE stats SET correct = ? WHERE name = ?;");
			statement.bindLong(1, value);
			statement.bindString(2, user);
			
			// Execute statement
			statement.execute();
		}
		
		// Else give an error message
		else{
			Toast.makeText(myContext, "Could not update correct", Toast.LENGTH_SHORT).show();
		}
	}
	
	// Make a function to add a new user into the stats table
	public void addUser(SQLiteDatabase db, String name, String password){
		// Declare SQLiteStatement variable to hold statements to execute
		SQLiteStatement statement;
		
		// Find number of current users in the database
		int current_users = getNumberUsers(db);
		
		// Prepare statement to increment number of current users in the database
		statement = db.compileStatement("UPDATE db_info SET num_users = ? WHERE _id = ?;");
		statement.bindLong(1, ++current_users);
		statement.bindLong(2, 1);
		
		// Execute statement
		statement.execute();
		
		// Prepare statement to insert new row into stats table for this user
		statement = db.compileStatement("INSERT INTO stats VALUES(?,?,?,0,0);");
		statement.bindLong(1, current_users);
		statement.bindString(2, name);
		statement.bindString(3, password);
		
		// Execute insert
		statement.executeInsert();
		
		// Create new table in database for this users animal info
		db.execSQL("CREATE TABLE IF NOT EXISTS "+name+" (_id INTEGER PRIMARY KEY, match1 TEXT, match2 TEXT, match3 TEXT, frequency NUMERIC, color NUMERIC);");
		
		// Add data to new animals table
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(1,'cow','count','camp',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(2,'pig','egg','hey',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(3,'dog','dial','cog',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(4,'horse','hoarse','corse',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(5,'sheep','cheap','heat',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(6,'cat','cast','hat',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(7,'chicken','hen','rooster',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(8,'squirrel','squid','hurl',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(9,'duck','huck','puck',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(10,'frog','toad','rob',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(11,'turkey','toad','rob',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(12,'lion','ryan','brian',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(13,'tiger','toad','rob',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(14,'bear','there','hair',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(15,'monkey','toad','rob',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(16,'fish','dish','fishy',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(17,'parrot','carot','carat',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(18,'dolphin','doll','frolfin',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(19,'eagle','tickle','beagle',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(20,'donkey','dorky','dinkey',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(21,'wolf','wall','wool',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(22,'snake','snare','snape',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(23,'mouse','mice','mousie',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(24,'elephant','telephone','elle',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(25,'bee','beer','bean',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(26,'bat','but','bunt',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(27,'cricket','bum','bug',1,1);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(28,'goose','gas','loose',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(29,'rooster','toaster','roast',1,0);");
		statement.executeInsert();
		statement = db.compileStatement("INSERT INTO "+name+" VALUES(30,'owl','howl','towel',1,0);");
		statement.executeInsert();
	}
	
	// Make a function to determine if a given user name exists
	public boolean nameExists(SQLiteDatabase db, String name){
		// Declare variable to hold SQLiteStatements
		SQLiteStatement statement;
		
		// Get number of current users
		int current_users = getNumberUsers(db);
		
		// For loop to increment through each user and see if given name matches
		for(int i = 1; i <= current_users; i++){
			// Prepare statement to get name of this user from stats table
			statement = db.compileStatement("SELECT name FROM stats WHERE _id = ?;");
			statement.bindLong(1, i);
			
			// Execute statement and save it to current_name
			String current_name = statement.simpleQueryForString();
			
			// Check if current_name matches given name
			if(current_name.matches(name)){
				// If so return true
				return true;
			}
		}
		
		// If all users in database have been checked and no names match given name then 
			// return false
		return false;
	}
	
	// Make a function to determine if a given password is the correct password for a username
	public boolean checkPassword(SQLiteDatabase db, String name, String password){
		// Declare variable to hold SQLiteStatements
		SQLiteStatement statement;
		
		// Prepare statement to get password for given name
		statement = db.compileStatement("SELECT password FROM stats WHERE name = ?;");
		statement.bindString(1, name);
		
		// Execute statement and save value to current_password
		String current_password = statement.simpleQueryForString();
		
		// Return whether or not current_password matches given password
		return current_password.matches(password);
	}
}

